{% set page_toc = get_page_toc_object() %}

<div class="d-none d-xl-block col-xl-2 bd-toc">
  <nav id="bd-toc-nav">
    <ul class="nav section-nav flex-column">
      {% for item in page_toc.children recursive %}
        <li class="nav-item toc-entry toc-h{{ loop.depth + 1 }}">
          <a href="{{ item.url }}" class="nav-link">{{ item.title }}</a>
        {%- if item.children -%}
          <ul class="nav section-nav flex-column">
            {{ loop(item.children) }}
          </ul>
        {%- endif %}
        </li>
      {% endfor %}
    </ul>
  </nav>
</div>
